<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
    <script>
      let arr = [1,2,3,4]
      /**
       * a: 上一次处理值
       * b: 当前处值
       */
      let r1 = arr.reduce((a,b, index) => {
        return a + b
      })
      console.log(r1 )

      let r2 = arr.reduce((a,b, index) => {
        return a + b
      }, 100)
      console.log(r2)

    </script>
	</body>
</html>
